package com.cndw.kungfu.domain;

import com.cndw.kungfu.config.ConstantsModel;
import com.cndw.kungfu.ext.TimeProcesser;
import com.cndw.kungfu.vo.UnionCashCowVO;

/**
 * 帮派摇钱树
 * 
 * 
 * @author <a href="mailto:whz-work@163.com">汪洪州</a>
 * 
 * @since 1.0 Create on 2011-8-23
 */
public class UnionCashCow {

	/**
	 * 帮派Id
	 */
	private int unionId;

	/**
	 * 成长值
	 */
	private int growValue;

	/**
	 * 剩余奖励份数
	 */
	private int rewardCounts;

	public int getUnionId() {
		return unionId;
	}

	public void setUnionId(int unionId) {
		this.unionId = unionId;
	}

	public int getGrowValue() {
		return growValue;
	}

	public void setGrowValue(int growValue) {
		this.growValue = growValue;
	}

	public int getRewardCounts() {
		return rewardCounts;
	}

	public void setRewardCounts(int rewardCounts) {
		this.rewardCounts = rewardCounts;
	}

	public UnionCashCowVO toUnionCashCowVO(int waterTime) {
		return toUnionCashCowVO(waterTime, -1, -1);
	}

	public UnionCashCowVO toUnionCashCowVO(int getTime, int counts) {
		return toUnionCashCowVO(-1, getTime, counts);
	}

	public UnionCashCowVO toUnionCashCowVO(int waterTime, int getTime, int counts) {
		UnionCashCowVO vo = new UnionCashCowVO();
		vo.setUnionId(getUnionId());
		vo.setSurplusCounts(counts);
		vo.setGrowValue(getGrowValue());
		vo.setMaxGrowValue(ConstantsModel.growValue[3]);
		vo.setRewardCounts(getRewardCounts());
		vo.setWaterTime(waterTime == 0 ? TimeProcesser.getUnixTime() : waterTime + ConstantsModel.waterIntervalTime);
		vo.setGetTime(getTime == 0 ? TimeProcesser.getUnixTime() : getTime + ConstantsModel.rewardIntervalTime);
		return vo;
	}
}
